package se.webbzon.boltzmann.game.object.dialogue.factory;

import java.awt.Color;

import se.webbzon.boltzmann.game.object.dialogue.layout.DialogueLayout;
import se.webbzon.boltzmann.game.object.dialogue.word.SimpleDialogueWord;
import se.webbzon.boltzmann.game.object.dialogue.word.ColoredDialogueWord;
import se.webbzon.boltzmann.game.object.dialogue.word.AbstractDialogueWord;

public class ColoredDialogueWordFactory extends AbstractDialogueWordFactory {
	
	// The color of the text
	private final Color color;
	
	// The text string
	private final String text;
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new colored dialogue word factory with a given
	 * text and the default text color. **/
	public ColoredDialogueWordFactory(String text) {
		this(text,SimpleDialogueWord.getDefaultColor());
	}
	
	/** Creates a new colored dialogue word factory with a given
	 * text and text color. **/
	public ColoredDialogueWordFactory(String text, Color color) {
		this.color = color;
		this.text = text;
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public AbstractDialogueWord createWord(DialogueLayout layout) {
		return new ColoredDialogueWord(layout,text,color);
	}

}
